Option G design study + prototype: spec-carried boundary codecs on a flat proxy (#86) - #88
Merged
Merged
Conversation
… on a flat proxy Private module dol/_interface_wrap.py + tests. Design study for discussion #86. Claude-Session: https://claude.ai/code/session_01FLZ8T5a6Y4P3u25yC1JD9R
- *keys: KT var-positional now maps elementwise (was silent tuple corruption); **kwargs roles refuse loudly - unannotated params in spec methods refuse (UnderAnnotatedSpecError) — the silence-by-omission hole one level down - None defaults never encoded (leaf-domain rule; converges 3.10 implicit- Optional with 3.11+) - fast path guarded to no-default leading positional params - properties/classmethods in specs refuse instead of vanishing - wrapping a legacy dol Store warns (mixed-architecture stacks are scoped) - tests: all of the above + in-flight iterator survives stack extension, unspec'd dunders absent (no raw __or__ leak), nested Iterator[Iterator[KT]] Claude-Session: https://claude.ai/code/session_01FLZ8T5a6Y4P3u25yC1JD9R
- 3.10: positional-plan fallback for builtin slots with no text signature (dict-form specs over dict were red on the 3.10 CI matrix) - dict-form spec pickle/copy round-trip (from_dict now accepts its own normalized 3-tuple form) - explicit dunder access no longer escapes to the leaf (AttributeError, not a raw leaf-bound method answering in the wrong key domain) - __getitem__-only proxies refuse sequence-protocol iteration loudly - fast path handles keyword calls of the first param (spec name is the contract; re-emitted positionally for leaf-name independence) - Iterable args materialized (re-iterable contract); Iterator stays lazy - undeclared policy string validated; class cache keyed by spec source (content), dict-form uncached; dead NamedTuples removed - 7 new regression tests; 3.10 parity probes green Claude-Session: https://claude.ai/code/session_01FLZ8T5a6Y4P3u25yC1JD9R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Design study + experimental prototype for discussion #86: the maintainer's proposal of wrapt-inspired object proxies, KT/VT-annotated interface specs, and flatten-and-compile codec stacks — evaluated as Option G in the #86 option space.
misc/docs/dol_issue86_design.md— the design study (survived a 4-lens adversarial panel; corrections folded in and flagged)dol/_interface_wrap.py— private, experimental engine (not exported; stdlib-only leaf module)dol/tests/test_interface_wrap.py— 32 tests: census shapes, flat stacking, no-double-apply, pickle matrix, loudness policies, laziness, 3.10-parity rulesHeadline findings
_self_naming, loud pickle posture), not its transparency goal.Safety
Purely additive: no existing module touched except a CLAUDE.md docs-index row. Full suite green (559 passed incl. doctests); prototype doctests verified on Python 3.10 and 3.12.
Closes nothing; feeds discussions #86/#24/#35 and the #18/#5/#10 design conversations (open question 0: who owns the wrap_kvs endgame).
https://claude.ai/code/session_01FLZ8T5a6Y4P3u25yC1JD9R